<template>
  <!--在vue2template模板中的根元素只能是一个，不能是多个-->
  <div>
    <div>姓名:{{name}}</div>
    <div>年龄:{{38}}</div>
    <div>性别:{{gender==1?'男':'女'}}</div>
    <div>爱好:{{hobby.slice(0,1)}}</div>
    <div>求和:{{nums.reduce((prev,cur)=>prev+cur,0)}}</div>
  </div>
</template>

<script>
export default {
  data(){
    return{
      name:'Giles',
      gender:1,
      hobby:['basketball','football','apple'],
      nums:[10,20,30,59,89,67]
    }
  }
}
</script>

<style>

</style>